#ifndef CREDUNDANCE_H
#define CREDUNDANCE_H
#include <sys/types.h>          /* See NOTES */
#include <sys/socket.h>
#include "cdevicectrl.h"

class CRedundance : public QObject
{
public:
    explicit CRedundance(CDeviceCtrl *);
    ~CRedundance();

protected:
    void timerEvent(QTimerEvent *event);
    void InitUdpRecv();
    void StartUdpSend();
    void SetEncoderDecoder(QString encoderIp, uint32_t encoderPort, QString MuticastIp);
private:
    CDeviceCtrl *pParent;
    CDebugLog *pLog;
    int    pingCount;
    int m_RecvSocket;
    struct sockaddr_in encoder_addr, decoder_addr;
    char recvBuf[4];
    bool flag;
};

#endif // CREDUNDANCE_H
